package com.ruoyi.record.controller;

import com.ruoyi.api.system.utils.ShiroUtils;
import com.ruoyi.api.system.utils.poi.ExcelUtil;
import com.ruoyi.basic.domain.BasicUser;
import com.ruoyi.basic.service.IBasicUserService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.record.domain.RecordDept;
import com.ruoyi.record.domain.RecordPost;
import com.ruoyi.record.service.IRecordDeptService;
import com.ruoyi.record.service.IRecordPostService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 科室调整记录Controller
 * 
 * @author ruoyi
 * @date 2023-05-26
 */
@Controller
@RequestMapping("/record/post")
public class RecordPostController extends BaseController
{
    private String prefix = "record/post";

    @Autowired
    private IRecordDeptService recordDeptService;

    @RequiresPermissions("record:post:view")
    @GetMapping()
    public String post()
    {
        return prefix + "/post";
    }

    /**
     * 查询岗位调整记录列表
     */
    @RequiresPermissions("record:post:list")
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list()
    {
        startPage();
        List<RecordDept> list = recordDeptService.selectRecordDeptByLoginName(ShiroUtils.getLoginName());
        return getDataTable(list);
    }
}
